//
//  OsOrderComplainTypeModel.swift
//  Pods
//
//  Created by eme on 2017/4/11.
//
//

import UIKit
import ModelProtocol
import SwiftyJSON

class OsOrderComplainTypeModel:ModelProtocol{
    
    // MARK: Declaration for string constants to be used to decode and also serialize.
    internal let kOsOrderComplainTypeCategoriesKey: String = "categories"
    internal let kOsOrderComplainTypeEnabledKey: String = "enabled"
    internal let kOsOrderComplainTypeCompainTypeNameKey: String = "compainTypeName"
    internal let kOsOrderComplainTypeTypecodeKey: String = "typecode"
    internal let kOsOrderComplainTypeComplainTypeIdKey: String = "complainTypeId"
    internal let kOsOrderComplainTypeRemarkKey: String = "remark"
    
    
    // MARK: 属性
    var categories: String
    var enabled: String
    var compainTypeName: String
    var typecode: String
    var complainTypeId: Int
    var remark: String
    
    
    // MARK: 实现MikerSwiftJSONAble 协议， 解析json数据
    required  init?(json: JSON) {
        categories = json[kOsOrderComplainTypeCategoriesKey].stringValue
        enabled = json[kOsOrderComplainTypeEnabledKey].stringValue
        compainTypeName = json[kOsOrderComplainTypeCompainTypeNameKey].stringValue
        typecode = json[kOsOrderComplainTypeTypecodeKey].stringValue
        complainTypeId = json[kOsOrderComplainTypeComplainTypeIdKey].intValue
        remark = json[kOsOrderComplainTypeRemarkKey].stringValue
        
    }
    
    
    /**
     Generates description of the object in the form of a NSDictionary.
     - returns: A Key value pair containing all valid values in the object.
     */
    internal func dictionaryRepresentation() -> [String : AnyObject ] {
        
        var dictionary: [String : AnyObject ] = [ : ]
        
        dictionary.updateValue(categories as AnyObject, forKey: kOsOrderComplainTypeCategoriesKey)
        
        dictionary.updateValue(enabled as AnyObject, forKey: kOsOrderComplainTypeEnabledKey)
        
        dictionary.updateValue(compainTypeName as AnyObject, forKey: kOsOrderComplainTypeCompainTypeNameKey)
   
        dictionary.updateValue(typecode as AnyObject, forKey: kOsOrderComplainTypeTypecodeKey)
    
        dictionary.updateValue(complainTypeId as AnyObject, forKey: kOsOrderComplainTypeComplainTypeIdKey)
    
        dictionary.updateValue(remark as AnyObject, forKey: kOsOrderComplainTypeRemarkKey)
        
        
        return dictionary
    }
    
    
}
